
import java.awt.*;
import javax.swing.*;

@SuppressWarnings("serial")
public class ClockFrame extends JFrame {
	private JPanel Display;
	JLabel DisplayText;
	JButton BStart;
	JButton BStop;
	JButton BNull;
	JButton BClose;
	
	ClockFrame(String title){
		super(title);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);//damit es auf dem Mac auch weggeht
		
		BorderLayout metaLayout = new BorderLayout();
		GridLayout centerLayout = new GridLayout(0,1);
		JPanel myPanel=new JPanel();
		
		//das Panel vorbereiten
		setLocation(300, 50);
		setSize(400,450);
		setLayout(metaLayout);
		
		//das center-Panel vorbereiten
		myPanel.setLayout(centerLayout);
		this.add(myPanel, BorderLayout.CENTER);
		//das Display bearbeiten
		Display=new JDisplay();
		Display.setBackground(Color.black);
		DisplayText=new JLabel("00:00:000");
		DisplayText.setForeground(Color.green);
		DisplayText.setFont(new Font("Dialog", 0, 50));
		Display.add(DisplayText);
				
		myPanel.add(Display);
		BStart=new JButton("Start");
		myPanel.add(BStart);
		BStop=new JButton("Stopp");
		myPanel.add(BStop);
		BNull=new JButton("Null");
		myPanel.add(BNull);
		BClose=new JButton("Exit");
		myPanel.add(BClose);
			
		//Dummy-Layouts fr den Rahmen
		this.add((new JPanel()), BorderLayout.NORTH);
		this.add((new JPanel()), BorderLayout.LINE_START);
		this.add((new JPanel()), BorderLayout.LINE_END);
		this.add((new JPanel()), BorderLayout.SOUTH);
		centerLayout.setHgap(10);
		centerLayout.setVgap(10);
			
		setVisible( true);
	}
	
	void setDisplayText(long time){
		this.DisplayText.setText( String.valueOf(time));
	}
	void setDisplayText(String time){
		this.DisplayText.setText(time);
	}
	int getDisplayTextInt(){
		return 0;
	}
	
	String getDisplayText(){
		return this.DisplayText.getText();
	}
}
